<extend name="Public/layout" />

<block name="content">
    <section class="wrapper">
        <!-- page start-->
        <div class="row">
            <div class="col-md-12">
                <section class="panel">
                    <header class="panel-heading">
                        增加管理员
                    </header>
                    <div class="panel-body">
                        <div class=" form">
                            <form class="ajax-from-submit" action="{:U('Admin/AdminUser/add')}" method="post">
                                <div class="form-group">
                                    <label for="role_id">用户角色</label>
                                    <select name="role_id" id="role_id" class="form-control">
                                        <volist name="role" id="vo">
                                            <option value="{$vo.id}">{$vo.name}</option>
                                        </volist>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label for="username">用户名</label>
                                    <input name="username" type="text" class="form-control"  id="username" placeholder="请输入用户名" required>
                                </div>
                                <div class="form-group">
                                    <label for="password">登录密码</label>
                                    <input name="password" type="password" class="form-control"  id="password" placeholder="请输入登录密码" required>
                                </div>
                                <div class="form-group">
                                    <label for="realname">真实姓名</label>
                                    <input name="realname" type="text" class="form-control" id="realname" placeholder="请输入真实姓名" required>
                                </div>
                                <div class="form-group">
                                    <label for="phone">手机号码</label>
                                    <input name="phone" type="text" class="form-control" id="phone" placeholder="请输入手机号码" required>
                                </div>
                                <div class="form-group">
                                    <label for="email">邮箱</label>
                                    <input name="email" type="text" class="form-control" id="email" placeholder="请输入邮箱">
                                </div>
                                <div class="form-group">
                                    <label for="file_upload">文件</label>
                                    <input name="images" type="file" class="form-control" id="file_upload" placeholder="请输入邮箱" required>
                                </div>
                                <div class="form-group">
                                    <label for="status">状态</label>
                                    <select name="status" id="status" class="form-control">
                                        <option value="0">启用</option>
                                        <option value="1">禁用</option>
                                    </select>
                                </div>
                                <div class="form-group " >
                                    <button class="btn btn-info ajax-form-btn" type="submit">提交</button>
                                </div>
                            </form>
                        </div>
                    </div>
                </section>
            </div>

        </div>
        <!-- page end-->
    </section>
</block>

<block name="style">
    <link href="__ADMIN__/assets/bootstrap-fileinput/css/fileinput.min.css" rel="stylesheet">
</block>

<block name="javascript">
    <script type="text/javascript" src="__ADMIN__/assets/bootstrap-fileinput/js/fileinput.js"></script>
    <script type="text/javascript" src="__ADMIN__/assets/bootstrap-fileinput/js/locales/zh.js"></script>

    <script>
        //菜单高亮
        MenuHighlight('{:U("Admin/AdminUser/index")}');
        //文件上传
        $("#file_upload").fileinput({
            language: 'zh', //设置语言
            uploadUrl: '{:U("Security/FileUpload/image")}', //上传的地址
            allowedFileExtensions : ['jpg', 'png','gif','jpeg'], //接收的文件后缀
            showPreview : false,
            showUpload: true, //是否显示上传按钮
            showCaption: true, //是否显示标题
            showClose:false,
            uploadClass:'btn btn-info'
        });
    </script>
</block>